package com.talent.common.exception;


import com.talent.common.enums.TalentResponse;
import lombok.Data;

/**
 * @ClassName：TalentException
 * @Author: hszhou
 * @Date: 2024/10/21 13:35
 * @Description: 自定义异常
 */
@Data
public class TalentException extends RuntimeException{

    public TalentException(String msg){
        super(msg);
    }

    private TalentResponse response;
    public TalentException(TalentResponse response){
        super(response.getMessage());
        this.response = response;
    }

    public static  void  display(TalentResponse response){
        throw new TalentException(response);
    }
}
